package com.ynkbny.web.controller;

import com.ynkbny.service.TokenService;
import com.ynkbny.util.Res;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import lombok.extern.slf4j.Slf4j;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import javax.annotation.Resource;

/**
 * @Author YY
 * @Date 2023/8/1 10:21
 */
@Api(tags = "获取老狗web Token接口")
@RestController
@RequestMapping("/lg")
@Slf4j
public class TokenController {

    @Resource
    private TokenService tokenService;

    /**
     * 获取老狗web Token
     *
     * @Author YY
     * @return 结果
     */
    @ApiOperation("获取老狗web Token")
    @GetMapping("get")
    public Res<String> getToken() {
        log.info("请求参数：无");
        String gouWebToken = tokenService.getLaoGouWebToken();
        log.info("返回值：{}",gouWebToken);
        return Res.ok(gouWebToken);
    }
}
